package networkTopo;
/*
 * AttributeField.java
 *
 * Created on June 5, 2007, 11:48 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Sirius
 */
import java.util.*;
import java.io.*;

public class AttributeField {
    
    public String attrName;
    public ArrayList<String> valueField;
    /** Creates a new instance of AttributeField */
    public AttributeField() {
        attrName = new String();
        valueField = new ArrayList<String>();
    }
    
     public AttributeField(String name, String value) {
        attrName = new String();
        attrName = name;
        valueField = new ArrayList<String>();
        valueField.add(value);
    }
     
     public boolean isAttributeValueExist(String value) {
        return this.valueField.contains(value);
     }
     
     public boolean isAttributeNameMatch(String name) {
        boolean ret = (this.attrName.equals(name));
        //System.out.println("this.attrname is " + this.attrName + " " + name + " " + ret);
        return ret;
     }
     
     public void addAttributeValue(String value) {
        //attrName = new String();
        //valueField = new ArrayList<String>();
        this.valueField.add(value);
    }
}
